package com.bdmc.device.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdmc.common.annotation.DataColumn;
import com.bdmc.common.annotation.DataPermission;
import com.bdmc.common.core.mybatisplus.core.BaseMapperPlus;
import com.bdmc.device.domain.DevGpsRealtime;
import com.bdmc.device.domain.bo.DevGpsRealtimeBo;
import com.bdmc.device.domain.vo.DevGpsRealtimeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 实时位置信息Mapper接口
 *
 * @author bdmc
 * @date 2022-03-22
 */
public interface DevGpsRealtimeMapper extends BaseMapperPlus<DevGpsRealtime> {

    Page<DevGpsRealtimeVo> mySelectPage(@Param("page") Page<DevGpsRealtime> page, @Param("param") DevGpsRealtimeBo bo);

    @DataPermission({@DataColumn(value = "dp.dept_id")})
    List<DevGpsRealtimeVo> selectPersonRealtimeListAll(@Param("param") DevGpsRealtimeBo devGpsRealtimeBo);

    @DataPermission({@DataColumn(value = "dp.dept_id")})
    List<DevGpsRealtimeVo> selectCarRealtimeListAll(@Param("param") DevGpsRealtimeBo devGpsRealtimeBo);

    //@DataPermission({@DataColumn(value = "dp.dept_id")})
    List<Map<String, Object>> countHomeWorkPerson(@Param("deptId") Long deptId);

    //@DataPermission({@DataColumn(value = "dp.dept_id")})
    List<Map<String, Object>> countHomeWorkCar(@Param("deptId") Long deptId);

    @DataPermission({@DataColumn(value = "d.dept_id")})
    Integer countPerson();

    @DataPermission({@DataColumn(value = "d.dept_id")})
    Integer countCar();

    @DataPermission({@DataColumn(value = "d.dept_id")})
    Integer countFac();

    List<DevGpsRealtimeVo> queryUploadRealtime();
}
